package project3.datasets;

/**
 * Represents an attribute/column specification.
 * 
 * @author Antonio
 * @author Vika
 */
public interface Attribute extends Cloneable {

	/**
	 * @return Returns the index.
	 */
	int getIndex();

	/**
	 * @param index The index to set.
	 */
	void setIndex(int index);

	/**
	 * @return Returns the name.
	 */
	String getName();

	/**
	 * @param name The name to set.
	 */
	void setName(String name);

	/**
	 * Encodes the value (date, string, number) into a double.
	 * This is for performance reasons.
	 *  
	 * @param value The original value to encoded.
	 * @return Returns the encoded value.
	 */
	double encode(Object value);

	/**
	 * Decodes the encoded value into its original value (date, string, etc).
	 * 
	 * @param d The encoded value.
	 * @return Returns the decoded value.
	 */
	Object decode(double d);

	/**
	 * @return Returns whether or not this attribute is discrete.
	 */
	boolean isDiscrete();	
}